package zj.chunan.navigate.action;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import zj.chunan.navigate.service.NavigateManager;

public class NavigateJsonAction extends HttpServlet {
	
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		NavigateManager navigateManager = new NavigateManager();
		request.setAttribute("list", navigateManager
				.getChildrenById(new Integer(request.getParameter("id"))));
		RequestDispatcher dispatcher = request
				.getRequestDispatcher("/navigate/console-json.jsp");
		dispatcher.forward(request, response);
	}
	
	public String execute() throws Exception
    {
        return "success";
    }
}
